import request from "@/utils/request";

/**查询通道列表 */
export function listChannel(params) {
  return request({
    url: "/zk/channel/list",
    method: "get",
    params: params,
  });
}

/**新增通道 */
export function addChannel(data) {
  return request({
    url: "/zk/channel",
    method: "post",
    data: data,
  });
}

/**根据num查询通道 */
export function getChannelByNum(num) {
  return request({
    url: "/zk/channel/" + num,
    method: "get",
  });
}

/**修改通道 */
export function editChannel(data) {
  return request({
    url: "/zk/channel",
    method: "put",
    data: data,
  });
}

/**批量删除 */
export function delChannel(ids) {
  return request({
    url: "/zk/channel/" + ids,
    method: "delete",
  });
}

export function getSortList(deviceNum) {
  return request({
    url: "/zk/channel/getSortList/" + deviceNum,
    method: "get",
  });
}

export function getDeviceAndChannelByTdGuid(tdGuid) {
  return request({
    url: "/zk/channel/getDeviceAndChannelByTdGuid/" + tdGuid,
    method: "get",
  });
}
